package cn.edu.hunau.oop.day01;

import org.junit.Test;

/**
 * @author hb
 * @date 2025-08-04 15:49:17
 */
public class StudentTest {

    @Test
    public void test01(){
        //实例化一个学生类
        //new 关键字后面Student()表示的时Student中的无参数 构造器
        Student s1=new Student();
        //对属性进行赋值
        s1.sid="2019001";
        s1.name="张三";
        s1.major="软件工程";
        s1.className="软件工程1班";
    }

    @Test
    public void test02(){
        //Student s2=new Student();
        //s2.sid="2019002";
        //s2.name="李四";

        Student s2=new Student("2019002","李四");
        System.out.println(s2.sid+" "+s2.name);
    }

    @Test
    public void test03(){
        Student s3=new Student("2019003","王五","软件工程","软件工程2班");
        System.out.println(s3.sid+" "+s3.name+" "+s3.major+" "+s3.className);
    }
}
